package com.hopu.v1.controller.front.personal;

import com.hopu.v1.pojo.classes.EmploymentInfo;
import com.hopu.v1.pojo.common.R;
import com.hopu.v1.service.front.personal.FEmploymentService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/v1/front/employment")
public class FEmploymentController {
    @Resource
    private FEmploymentService employmentService;


    /**
     * 根据学生id查询
     * @param studentId
     * @return
     */
    @GetMapping
    public R getEmpList(Integer studentId){
        System.out.println("studentId = " + studentId);
       return R.ok(employmentService.lambdaQuery().eq(EmploymentInfo::getStudentId,studentId).list());
    }

    /**
     * 添加就业信息
     * @param employmentInfo
     * @return
     */
    @PostMapping
    public R addEmpInfo(@RequestBody EmploymentInfo employmentInfo){
        System.out.println("employmentInfo = " + employmentInfo);
        return R.ok(employmentService.save(employmentInfo));
    }
}
